#include "XMLResponse.h"

namespace http {
  XMLResponse::XMLResponse(const std::string &b, const std::string &h)
    : Response(b, h), header(h)
  {
    bodyDoc = xmlParseMemory(b.c_str(), b.size());
  }

  std::string XMLResponse::getBody() const {
    xmlChar *xmlbuff;
    int buffersize;

    xmlDocDumpFormatMemory(bodyDoc, &xmlbuff, &buffersize, 1);
    return std::string((char *) xmlbuff);
  }
}
